****Replication do file for Crowder-Meyer and Ferrín, "The Effects of Ideological and Ethnoracial Identity on Political (Mis)Information," Public Opinion Quarterly

**Data for replication can be downloaded at https://www.journalism.org/dataset/spring-2018-survey-on-factual-and-opinion-statements-in-the-news/


****Dependent variables: statements

*Dependent variable 1: Dichotomous items (correct answers)
recode FACTOPIN1 (2=0) (99=.), gen(healthcareC)
recode FACTOPIN2 (2=0) (99=.), gen(obamaC)
recode FACTOPIN3 (2=0) (99=.), gen(immrightsC)
recode FACTOPIN4 (2=0) (99=.), gen(isisC)
recode FACTOPIN5 (2=0) (99=.), gen(socialcostC)
recode FACTOPIN7 (1=0) (2=1) (99=.), gen(wageC)
recode FACTOPIN8 (1=0) (2=1) (99=.), gen(abortionC)
recode FACTOPIN9 (1=0) (2=1) (99=.), gen(immproblemC)
recode FACTOPIN10 (1=0) (2=1) (99=.), gen(governmentC)
recode FACTOPIN11 (1=0) (2=1) (99=.), gen(muslimsC)

*Dependent variable 2: statements scales

*Ideological statements scale
recode abortionC (1=0) (0=1), gen(abortionCc)
recode wageC (1=0) (0=1), gen(wageCc)
recode isisC (1=0) (0=1), gen(isisCc)
recode socialcostC (1=0) (0=1), gen(socialcostCc)
recode muslims (1=0) (0=1), gen(muslimsCc)
egen ideolscale=rowtotal(obamaC immrightsC healthcareC immproblemC governmentC abortionCc wageCc isisCc socialcostCc muslimsCc), m
replace ideolscale=ideolscale/10

*Ethnoracial statements scale
egen racescale=rowtotal(obamaC immproblemC immrightsC muslimsCc), m
replace racescale=racescale/4


****Independent variables: sex, age, education, trust in media, ethnoracial membership, ideology, partisanship

recode PPGENDER (1=0) (2=1), gen(sex)
label define sex 0 "male" 1 "female"
label value sex sex
gen age=PPAGE
recode PPEDUCAT (1/2=1) (3=2) (4=3), gen(educ_r)
label define educ_r 1 "highschool" 2 "college" 3 "=>bachelor"
label value educ_r educ_r
recode GROUP_TRUST_a (4=1) (3=2) (2=3) (1=4) (99=.), gen(trustmedia)
recode PPETHM (3=4) (4=3) (5=4), gen(race4)
label define race4 1 "white" 2 "black" 3 "latino" 4 "other"
label value race4 race4
recode IDEO (1/2=3) (3=2) (4/5=1) (99=.), gen(ideolr)
label define ideolr 1 "liberal" 2 "moderate" 3 "conservative"
label value ideolr ideolr
recode IDEO (99=.)
recode PARTY (99=.)


****Table 2: Differences by ideology and ethnoracial membership
mean obamaC immrightsC healthcareC immproblemC governmentC abortionC wageC isisC socialcostC muslimsC ideolscale [aw=weight], over(ideolr)
mean obamaC immrightsC  immproblemC muslimsC racescale [aw=weight], over(race4)
*Logistic regression models, Table SM2
logit obamaC sex age i.educ_r  PPINCIMP i.race4 i.ideolr i.PARTY  trustmedia [pw=weight]
logit immproblemC sex age i.educ_r  PPINCIMP i.race4 i.ideolr i.PARTY  trustmedia [pw=weight]
logit abortionC sex age i.educ_r  PPINCIMP i.race4 i.ideolr i.PARTY  trustmedia [pw=weight]
logit governmentC sex age i.educ_r  PPINCIMP i.race4 i.ideolr i.PARTY  trustmedia  [pw=weight]
logit immrightsC sex age i.educ_r  PPINCIMP i.race4 i.ideolr i.PARTY  trustmedia [pw=weight]
logit isisC sex age i.educ_r  PPINCIMP i.race4 i.ideolr i.PARTY  trustmedia [pw=weight]
logit wageC sex age i.educ_r  PPINCIMP i.race4 i.ideolr i.PARTY  trustmedia [pw=weight]
logit socialcostC sex age i.educ_r  PPINCIMP i.race4 i.ideolr i.PARTY  trustmedia [pw=weight]
logit healthcareC sex age i.educ_r  PPINCIMP i.race4 i.ideolr i.PARTY  trustmedia [pw=weight]
logit muslimsC sex age i.educ_r  PPINCIMP i.race4  i.ideolr i.PARTY  trustmedia [pw=weight]


****Table 3 and Figure 1
regress ideolscale sex age i.educ_r i.race4 PPINCIMP i.PARTY i.ideolr trustmedia  [aw=weight]
margins i.ideolr
marginsplot, recast(scatter)
graph save ideol.gph
margins PARTY
marginsplot, recast(scatter) 
graph save PARTY1.gph
regress racescale sex age i.educ_r i.race4 PPINCIMP i.PARTY i.ideolr trustmedia   [aw=weight]
margins i.race4
marginsplot, recast(scatter) 
graph save race.gph
margins i.PARTY
marginsplot, recast(scatter) 
graph save PARTY2.gph
graph combine ideol.gph PARTY1.gph race.gph PARTY2.gph, ycommon

****Figures 2 and 3, Table SM3
regress ideolscale sex age i.educ_r  PPINCIMP i.PARTY i.race4##i.ideolr trustmedia if race4!=4 [aw=weight]
margins ideolr#race4
marginsplot, recast(scatter)
regress racescale sex age i.educ_r  PPINCIMP i.PARTY i.race4##i.ideolr trustmedia if race4!=4 [aw=weight]
margins race4#ideolr
marginsplot, recast(scatter)


****Table SM4 and Figures SM1 and SM2 
regress ideolscale sex age i.educ_r  PPINCIMP  i.race4##i.PARTY i.ideolr trustmedia if race4!=4 & PARTY<4 [aw=weight]
margins PARTY#race4
marginsplot, recast(scatter)
regress racescale sex age i.educ_r  PPINCIMP  i.race4##i.PARTY i.ideolr trustmedia if race4!=4 & PARTY<4 [aw=weight]
margins race4#PARTY
marginsplot, recast(scatter)


****Figure SM3 and significance tests
hist obamaI if ideolr==3 & index_politicalawareness!=2, percent  by(index_politicalawareness)
ttest obamaI if ideolr==3 & index_politicalawareness!=2, by(index_politicalawareness)
ttest obamaI if ideolr==1 & index_politicalawareness!=2, by(index_politicalawareness)





